import React from 'react';
import {connect} from "react-redux";

function CrumbArea(props:any) {
    let { crumbList } = props
    return (
        <div>
            {   crumbList && crumbList.length>0&&
                crumbList.map((item:{key:string,label:string,children?:[]},index:number)=>{
                    return (
                        <span key={item.key}>
                            <span className="crumbName">{item.label}</span>
                            {
                                index< crumbList.length-1?<span className="crumbLine">/</span>:""
                            }
                        </span>
                    )
                })
            }
        </div>
    );
}
const mapStateToProps = (state:any)=> state.menuList
export default connect(mapStateToProps,null)(CrumbArea);
